
*********************************************
****   Description   ************************
*********************************************

*This program estimates regressions of subsequent accounts opened at the Freedman's Savings Bank on advertisements, generating "Table 4. Advertising and Deposit Collection - Panel Analysis across Branches of the Freedman's Savings Bank."


*********************************************
****   Weekly analysis - Advertising ******** 
*********************************************

use  "$Data/AdvertisingAccounts_WeeklyPanel_December2024.dta", clear 

//Variables

*Log
gen ln_accounts=ln(num_account)
gen ln_accounts_black =ln(num_account_black)
gen ln_accounts_white=ln(num_account-num_account_black)

*number of advertisements in non aa newspapers
gen sum_week_lag2=sum_week_lag-sum_week_aa_lag

//Regressions

eststo clear
reghdfe ln_accounts  sum_week_lag [pw= black_pop_1870], absorb(mo_date code_branch ) cluster(mo_date)  
eststo
reghdfe ln_accounts  sum_week_lag [pw= black_pop_1870], absorb(code_branch##mo_date) cluster(mo_date)
eststo  
reghdfe ln_accounts  sum_week_lag2 sum_week_aa_lag [pw= black_pop_1870], absorb( code_branch##mo_date) cluster(mo_date)
eststo  
reghdfe ln_accounts_black sum_week_lag2 sum_week_aa_lag [pw= black_pop_1870], absorb(mo_date code_branch ) cluster(mo_date)  
eststo
reghdfe ln_accounts_black sum_week_lag2 sum_week_aa_lag [pw= black_pop_1870], absorb( code_branch##mo_date) cluster(mo_date)
eststo  



* keep two only branches with BOTH AA and general audience newspapers 
keep if branch == "Washington" | branch == "NewOrleans"   

reghdfe share_acc_black  share_articles_aa_lag [pw= black_pop_1870], absorb(mo_date code_branch) cluster(mo_date)  
eststo



esttab , keep(sum_week_lag sum_week_aa_lag sum_week_lag2 share_articles_aa_lag)  ///
b(%10.2f) se(%10.2f) order(sum_week_lag sum_week_aa_lag share_articles_aa_lag) ///
starlevels(* .10 ** .05 *** .01) nolegend ///
nonumbers ///
nonotes mlabels(none) /// 
stats(N r2 , fmt(%9.0fc %9.2f) label( "Observations" "$ R^{2} $"  ))

 
